﻿#region 命名空间

using System;
using System.Web.Mvc;
using WinnerCMS.BLL;
using WinnerCMS.Common;
using WinnerCMS.Model;
using WinnerCMS.WebControls;
using WinnerCMS.WebFactory;

#endregion

namespace WinnerCMS.WebUI.Templates.WinnerCMS6.Announce
{
    public partial class Index : PublicPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                BindList(1);
        }

        private void BindList(int pageNo)
        {
            var bll = new AnnounceManage();
            var pp = new PagingParam {PageSize = this.PageNavigation1.PageSize, PageNo = pageNo};
            this.Repeater1.DataSource = bll.BindList(true, pp);

            this.Repeater1.DataBind();
            this.PageNavigation1.RecordCount = pp.RecordCount;
        }


        protected void PageNavigation1_PageChanging(object src, PageChangingEventArgs e)
        {
            BindList(e.NewPageIndex);
        }
    }
}